package com.wc.算法基础课.A第一讲基础算法.多路归并.鱼塘钓鱼;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/8 0:04
 * @description https://www.acwing.com/problem/content/1264/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 110;
    static int[] a = new int[N];
    static int[] d = new int[N];
    static int[] dis = new int[N];
    static int[] spend = new int[N];
    static int n, T;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        for (int i = 1; i <= n; i++) d[i] = sc.nextInt();
        for (int i = 2; i <= n; i++) {
            dis[i] = sc.nextInt();
            dis[i] += dis[i - 1];
        }
        T = sc.nextInt();
        int res = 0;
        for (int i = 1; i <= n; i++) {
            // 到达i
            int reT = T - dis[i];
            res = Math.max(res, work(reT, i));
        }
        out.println(res);
        out.flush();
    }

    static int get(int k) {
        return Math.max(0, a[k] - d[k] * spend[k]);
    }

    static int work(int T, int n) {
        Arrays.fill(spend, 1, n + 1, 0);
        int res = 0;
        for (int i = 1; i <= T; i++) {
            int k = 1;
            for (int j = 1; j <= n; j++) {
                if (get(k) < get(j)) {
                    k = j;
                }
            }
            res += get(k);
            spend[k]++;
        }
        return res;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
